package com.lzx.adx.report.model.sfkj;

import com.lzs.adx.commmon.utils.JsonUtils;
import com.lzx.adx.report.dto.ReportDTO;
import com.lzx.adx.report.model.common.CommonReportRequest;
import lombok.Data;

@Data
public class SfkjRequest{
    private String dspId;
    private String campaignId;

    private String adgroupId;

    private String contentId;
    /**
     * 1 点击2 曝光
     */
    private String action;
    /**
     * 1.安卓 2.IOS
     */
    private String src;

    private String product;

    private String channel;

    private String subchannel;


    private String imei;

    private String imeiSum;


    private String oaid;


    private String oaidSum;

    private String idfa;

    private String os;

    private String ip;





    private String ua;

    private String time;

    private String callbackUrl;







    public ReportDTO builderReportDTO(){
        ReportDTO reportDTO = new ReportDTO();
        reportDTO.setDspId(this.dspId );
//        if ("1".equals(action)){
            reportDTO.setEventType("click");
//        }else if ("2".equals(action)){
//            reportDTO.setEventType("imp");
//        }
        reportDTO.setTraceTime(this.time);
        reportDTO.setIp(this.ip);
        reportDTO.setOaid(this.oaid);
        reportDTO.setCampaignId(this.campaignId);
        reportDTO.setAdgroupId(this.adgroupId);
        reportDTO.setContentId(this.contentId);
        reportDTO.setCallback(this.callbackUrl);
        reportDTO.setChannel("sfkj");
        reportDTO.setTagId("sfkj");
        reportDTO.setImei(this.imei);
        reportDTO.setUser_agent(this.ua);
        reportDTO.setExtend(JsonUtils.toJsonString(this));
        return reportDTO;
    }


}
